-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New dashboard #4330
base: develop
Are you sure you want to change the base?
New dashboard #4330
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #4330 +/- ##
============================================
- Coverage 77.59% 55.05% -22.55%
============================================
Files 944 950 +6
Lines 44624 44620 -4
============================================
- Hits 34628 24564 -10064
- Misses 9996 20056 +10060
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
… to allow i-frame.
@srugano regenerate lock |
@srugano regenerate pdm |
src/hct_mis_api/apps/dashboard/static/dashboard/js/dashboard.js
Outdated
Show resolved
Hide resolved
src/hct_mis_api/apps/dashboard/static/dashboard/js/dashboard.js
Outdated
Show resolved
Hide resolved
src/hct_mis_api/apps/dashboard/static/dashboard/js/dashboard.js
Outdated
Show resolved
Hide resolved
assert "0" in pageCountryDashboard.getTotalNumberOfFeedback().text | ||
assert "USD 0.00" in pageCountryDashboard.getTotalAmountTransferred().text | ||
pageCountryDashboard.switch_to_dashboard_iframe() | ||
# assert pageCountryDashboard.get_total_amount_paid().text == "", "Expected total amount paid to be empty." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are these tests commented out?
from typing import List, Optional | ||
|
||
from django.http import HttpRequest, HttpResponse | ||
from django.utils.deprecation import MiddlewareMixin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@johniak, @MarekBiczysko Please check if this middleware is correct. I needed to overwrite the default django setting in order to display dashboard page in an iframe
""" | ||
Test that generate_dash_report_task refreshes data for the given business area. | ||
""" | ||
mock_refresh_data = mocker.patch.object(DashboardDataCache, "refresh_data") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the wrong way to call patch.object. You are not patching an object here
mock_household_objects.using.return_value.filter.return_value = mock_households | ||
mock_serializer.return_value.data = {"id": 1, "name": "test"} | ||
|
||
with patch.object(DashboardDataCache, "store_data") as mock_store_data: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can be done with monkeypatch and it is more correct in this case
assert "0" in pageCountryDashboard.getTotalNumberOfGrievances().text | ||
assert "0" in pageCountryDashboard.getTotalNumberOfFeedback().text | ||
assert "USD 0.00" in pageCountryDashboard.getTotalAmountTransferred().text | ||
pageCountryDashboard.switch_to_dashboard_iframe() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what are these commented out lines?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still updating the figures
@patch.object(DashboardDataCache, "refresh_data") | ||
@patch("hct_mis_api.apps.core.models.BusinessArea.objects") | ||
def test_update_dashboard_figures( | ||
mock_business_area_objects: MagicMock, mock_refresh_data: MagicMock, afghanistan: BusinessArea |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where are these fixtures ?
AB#219780